package com.jay.image

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CircleCrop
import com.bumptech.glide.request.RequestOptions

/**
 *
 * @author zhouxu
 * @email 1419982188@qq.com
 * @date 2021/7/5
 */
object ImageLoader {

    fun load(imageView: ImageView, url: String) {
        Glide.with(imageView)
            .load(url)
            .into(imageView)
    }

    fun loadCircle(imageView: ImageView, url: Int) {
        Glide.with(imageView)
            .load(url)
            .apply(RequestOptions.bitmapTransform(CircleCrop()))
            .into(imageView)
    }

    fun loadCircle(imageView: ImageView, url: String) {
        Glide.with(imageView)
            .load(url)
            .apply(RequestOptions.bitmapTransform(CircleCrop()))
            .into(imageView)
    }
}